import http from "@/utils/http";
export function upload(formData){
  return http.post("/api/bills/qiniu/upload",formData);
}

export function addExpense(expense){
  return http.post("/api/bills/expense/",expense);
}

export function addIncome(income){
  return http.post("/api/bills/income/",income);
}


export function queryUserExpensePageByUid(uid,currentPageNum){
  let params = {
    uid: uid,
    currentPageNum: currentPageNum
  };
  return http.get("/api/bills/expense/pager",params);
}

export function queryUserIncomePageByUid(uid,currentPageNum){
  let params = {
    uid: uid,
    currentPageNum: currentPageNum
  };
  return http.get("/api/bills/income/pager",params);
}

export function queryUserExpenseDetailsInfo(id){
  return http.get("/api/bills/expense/"+id);
}

export function queryUserIncomeDetailsInfo(id){
  return http.get("/api/bills/income/"+id);
}

export function searchUserExpenseMonthView(uid,realName,month,currentPageNum){
  let params={
    uid: uid,
    realName: realName,
    month: month,
    currentPageNum: currentPageNum
  };
  return http.get("/api/bills/expense/search",params);
}

export function searchUserIncomeMonthView(uid,realName,month,currentPageNum){
  let params={
    uid: uid,
    realName: realName,
    month: month,
    currentPageNum: currentPageNum
  };
  return http.get("/api/bills/income/search",params);
}


export function exportUserExpenseMonthViewToExcel(uid,realName,month,currentPageNum){
  let params={
    uid: uid,
    realName: realName,
    month: month,
    currentPageNum: currentPageNum
  };
  return http.get("/api/bills/expense/export",params);
}

export function exportUserIncomeMonthViewToExcel(uid,realName,month,currentPageNum){
  let params={
    uid: uid,
    realName: realName,
    month: month,
    currentPageNum: currentPageNum
  };
  return http.get("/api/bills/income/export",params);
}

export function getUserExpenseMonthChartInfo(type,uid,realName,month){
  let params={
    uid: uid,
    realName: realName,
    month: month

  };

  return http.get("/api/bills/expense/echarts/"+type,params);
}

export function getUserIncomeMonthChartInfo(type,uid,realName,month){
  let params={
    uid: uid,
    realName: realName,
    month: month

  };

  return http.get("/api/bills/income/echarts/"+type,params);
}

